﻿using LuShanTea.Service.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.Service.ModelConfig
{
    public class CityConfig : EntityTypeConfiguration<City>
    {
        public CityConfig()
        {
            this.ToTable("T_Cities");

            HasRequired(c => c.Province).WithMany().HasForeignKey(c => c.ProId).WillCascadeOnDelete(false);

            Property(c => c.Name).IsRequired().HasMaxLength(16);
        }
    }
}
